package com.example.demo.design_patterns.decorator;

/**
 * 装饰模式
 * 给一类对象增加新的功能，装饰方法与具体的内部逻辑无关
 *
 * @author: htc
 * @date: Created in 10:19 2019/3/13.
 */
public class Decorator implements Source {
    private Source source;

    public void decotate(){
        System.out.println("decorator");
    }

    @Override
    public void method() {
        decotate();
        source.method();
    }
}
